{include file="common/head" /}
<body class="login-bg">
    
    <div class="login">
        <div class="message">Flowers</div>
        <div id="darkbannerwrap"></div>
        
        <!--<form method="post" class="layui-form" action="/admin/do_login">-->
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit" onclick="submit()">
            <hr class="hr20" >
        <!--</form>-->
    </div>
<script>
function submit() {
    layui.use('layer', function() {
        var layer = layui.layer;

        $.post('/admin/do_login', {
            username: $('input[name=username]').val(),
            password: $('input[name=password]').val()
        }, function (ret) {
            if(ret.code == 1){
                layer.msg(ret.msg, {icon: 6},function () {
                    window.location.href=ret.url;
                });
            }else{
                layer.msg(ret.msg, {icon: 5});
            }
        }, 'json');
    });
}
</script>
</body>
</html>